[MINIOS] Exports a function to have all Xen ports unbound.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Mon, 27 Nov 2006 10:03:35 +0000 (10:03 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Mon, 27 Nov 2006 10:03:35 +0000 (10:03 +0000)
This is necessary when using mini-os as the foundation for a boot-loader.

Signed-off-by: Jacob Gorm Hansen <jacobg@diku.dk>
extras/mini-os/events.c

index e05f68d83dbb3d0f053910223362c79a3d288ebd..5d60ab70fc9bc40f4c00acc3d4f23d08c8a5cba8 100644 (file)
@@ -35,6 +35,21 @@ typedef struct _ev_action_t {
 static ev_action_t ev_actions[NR_EVS];
 void default_handler(evtchn_port_t port, struct pt_regs *regs, void *data);
 
+void unbind_all_ports(void)
+{
+    int i;
+
+       for(i=0;i<NR_EVS;i++)
+       {
+               if(ev_actions[i].handler != default_handler)
+               {
+                       struct evtchn_close close;
+                       mask_evtchn(i);
+                       close.port = i;
+                       HYPERVISOR_event_channel_op(EVTCHNOP_close, &close);
+               }
+       }
+}
 
 /*
  * Demux events to different handlers.